home *** CD-ROM | disk | FTP | other *** search
- /*
- File: DriverFamilyMatching.h
-
- Contains: xxx put contents here xxx
-
- Version: Technology: xxx put the technology version here xxx
- Release: Universal Interfaces 3.0d3 on Copland DR1
-
- Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
- #ifndef __DRIVERFAMILYMATCHING__
- #define __DRIVERFAMILYMATCHING__
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
- #ifndef __NAMEREGISTRY__
- #include <NameRegistry.h>
- #endif
- #ifndef __TEXTOBJECTS__
- #include <TextObjects.h>
- #endif
- #ifndef __CODEFRAGMENTS__
- #include <CodeFragments.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
- /* Please refer to Devices.i for DriverDescriptor definition for Marconi */
- #if FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE
- /*
- #########################################################
- Descriptor for Drivers and NDRVs
- #########################################################
- */
- /* Driver Typing Information Used to Match Drivers With Devices */
- struct DriverType {
- Str31 nameInfoStr; /* Driver Name/Info String*/
- NumVersion version; /* Driver Version Number*/
- };
- typedef struct DriverType DriverType;
-
- typedef DriverType *DriverTypePtr;
- /* OS Runtime Information Used to Setup and Maintain a Driver's Runtime Environment */
- typedef OptionBits RuntimeOptions;
-
- enum {
- kDriverIsLoadedUponDiscovery = 0x00000001, /* auto-load driver when discovered*/
- kDriverIsOpenedUponLoad = 0x00000002, /* auto-open driver when loaded*/
- kDriverIsUnderExpertControl = 0x00000004, /* I/O expert handles loads/opens*/
- kDriverIsConcurrent = 0x00000008, /* supports concurrent requests*/
- kDriverQueuesIOPB = 0x00000010, /* device manager doesn't queue IOPB*/
- kDriverIsLoadedAtBoot = 0x00000020, /* Driver is loaded at the boot time */
- kDriverIsForVirtualDevice = 0x00000040 /* Driver is for a virtual Device */
- };
-
- struct DriverOSRuntime {
- RuntimeOptions driverRuntime; /* Options for OS Runtime*/
- Str31 driverName; /* Driver's name to the OS*/
- UInt32 driverDescReserved[8]; /* Reserved area*/
- };
- typedef struct DriverOSRuntime DriverOSRuntime;
-
- typedef DriverOSRuntime *DriverOSRuntimePtr;
- /* OS Service Information Used To Declare What APIs a Driver Supports */
- typedef UInt32 ServiceCount;
- struct DriverServiceInfo {
- OSType serviceCategory; /* Service Category Name*/
- OSType serviceType; /* Type within Category*/
- NumVersion serviceVersion; /* Version of service*/
- };
- typedef struct DriverServiceInfo DriverServiceInfo;
-
- typedef DriverServiceInfo *DriverServiceInfoPtr;
- struct DriverOSService {
- ServiceCount nServices; /* Number of Services Supported*/
- DriverServiceInfo service[1]; /* The List of Services (at least one)*/
- };
- typedef struct DriverOSService DriverOSService;
-
- typedef DriverOSService *DriverOSServicePtr;
- /* Categories */
-
- enum {
- kServiceCategoryDisplay = 'disp', /* Display Manager*/
- kServiceCategoryOpenTransport = 'otan', /* Open Transport*/
- kServiceCategoryBlockStorage = 'blok', /* Block Storage*/
- kServiceCategoryNdrvDriver = 'ndrv', /* Generic Native Driver*/
- kServiceCategoryScsiSIM = 'scsi', /* SCSI */
- kServiceCategoryFileManager = 'file', /* File Manager */
- kServiceCategoryIDE = 'ide-', /* ide */
- kServiceCategoryADB = 'adb-', /* adb */
- kServiceCategoryPCI = 'pci-', /* pci bus */
- /* Nu Bus */
- kServiceCategoryPCMCIA = 'pcmc', /* PCMCIA */
- kServiceCategoryDFM = 'dfm-', /* DFM */
- kServiceCategoryMotherBoard = 'mrbd', /* mother Board */
- kServiceCategoryKeyboard = 'kybd', /* Keyboard */
- kServiceCategoryPointing = 'poit', /* Pointing */
- kServiceCategoryRTC = 'rtc-', /* RTC */
- kServiceCategoryNVRAM = 'nram', /* NVRAM */
- kServiceCategorySound = 'sond', /* Sound (1/3/96 MCS) */
- kServiceCategoryPowerMgt = 'pgmt', /* Power Management */
- kServiceCategoryGeneric = 'genr' /* Generic Service Category to receive general Events */
- };
-
- /* Ndrv ServiceCategory Types */
-
- enum {
- kNdrvTypeIsGeneric = 'genr', /* generic*/
- kNdrvTypeIsVideo = 'vido', /* video*/
- kNdrvTypeIsBlockStorage = 'blok', /* block storage*/
- kNdrvTypeIsNetworking = 'netw', /* networking*/
- kNdrvTypeIsSerial = 'serl', /* serial*/
- kNdrvTypeIsSound = 'sond', /* sound*/
- kNdrvTypeIsBusBridge = 'brdg'
- };
-
- typedef UInt32 DriverDescVersion;
- /* The Driver Description */
-
- enum {
- kInitialDriverDescriptor = 0,
- kVersionOneDriverDescriptor = 1
- };
-
-
- enum {
- kTheDescriptionSignature = 'mtej',
- kDriverDescriptionSignature = 'pdes'
- };
-
- struct DriverDescription {
- OSType driverDescSignature; /* Signature field of this structure*/
- DriverDescVersion driverDescVersion; /* Version of this data structure*/
- DriverType driverType; /* Type of Driver*/
- DriverOSRuntime driverOSRuntimeInfo; /* OS Runtime Requirements of Driver*/
- DriverOSService driverServices; /* Apple Service API Membership*/
- };
- typedef struct DriverDescription DriverDescription;
-
- typedef DriverDescription *DriverDescriptionPtr;
- #endif
- #if FOR_SYSTEM8_PREEMPTIVE
- /*
- ################################################
- Family Matching Data Structure
- ################################################
- */
- /* The Family Type */
-
- enum {
- kFamilyIsHighLevel = 0, /* High Level Family */
- kFamilyIsLowLevel = 1 /* Low Level Family */
- };
-
- typedef UInt32 FamilyLevel;
- /* Family Typing Information Used to Match Families With plug-ins and Devices */
- struct FamilyType {
- FamilyLevel familyLevel; /* Kind of Family */
- OSType familyName; /* Family Name */
- NumVersion version; /* Family Version Number*/
- OSType reserved; /* Used by Mother Board Expert */
- };
- typedef struct FamilyType FamilyType;
-
- typedef FamilyType *FamilyTypePtr;
-
- enum {
- kFamilyIsLoadedAtBoot = 0x00000001, /* Family is loaded at the boot time */
- kFamilyIsLoadedUponDiscovery = 0x00000002, /* auto-load Family when discovered */
- kFamilyIsStartedAtBoot = 0x00000004 /* Family is initialized at the Boot */
- };
-
- typedef UInt32 FamilyOSRunTimeOptions;
- struct FamilyOSRunTime {
- FamilyOSRunTimeOptions familyRuntime; /* Options for OS Runtime*/
- Str31 familyName; /* Family's name to the OS*/
- UInt32 familyDescReserved[8]; /* Reserved area*/
- };
- typedef struct FamilyOSRunTime FamilyOSRunTime;
-
- typedef FamilyOSRunTime *FamilyOSRunTimePtr;
- /* The Family Description */
-
- enum {
- kFamilyDescriptionSignature = 'fdes'
- };
-
- typedef UInt32 FamilyDescVersion;
-
- enum {
- kInitialFamilyDescriptor = 0,
- kMotherBoardDescriptor = 1
- };
-
- typedef UInt32 DependencyCount;
- struct MatchingAndDependencyInfo {
- union {
- Str31 deviceName; /* the device name to match */
- OSType dependency; /* Dependency List */
- } u;
- };
- typedef struct MatchingAndDependencyInfo MatchingAndDependencyInfo;
-
- typedef MatchingAndDependencyInfo *MatchingAndDependencyInfoPtr;
- struct FamilyMatchingAndDependency {
- DependencyCount nrElements; /* Number of elements in the Array */
- MatchingAndDependencyInfo matchingInfo[1];
- };
- typedef struct FamilyMatchingAndDependency FamilyMatchingAndDependency;
-
- typedef FamilyMatchingAndDependency *FamilyMatchingAndDependencyPtr;
- struct FamilyDescription {
- OSType familyDescSignature; /* Signature field of this structure*/
- FamilyDescVersion familyDescVersion; /* Version of this data structure*/
- FamilyType familyType; /* Type of Driver*/
- FamilyOSRunTime familyOSRuntime; /* OS Runtime Requirements of Family */
- FamilyMatchingAndDependency familymatchingAndDependency; /* Family Dependency Info */
-
- };
- typedef struct FamilyDescription FamilyDescription;
-
- typedef FamilyDescription *FamilyDescriptionPtr;
- /*
- ##############################################
- Definition of "driver-ptr" property
- ##############################################
- */
- struct DriverPtrProperty {
- LogicalAddress pluginLocator;
- UInt32 length;
- };
- typedef struct DriverPtrProperty DriverPtrProperty;
-
- typedef DriverPtrProperty *DriverPtrPropertyPtr;
- /*
- ##############################################
- Status Definition for DFMReportInitStatus
- ##############################################
- */
-
- enum {
- kInitStatusOK = 0,
- kInitStatusNotOK = 1
- };
-
- /*
- ##############################################
- Declare the pluginLoadID
- ##############################################
- */
- typedef struct OpaquePluginLoadID* PluginLoadID;
- /*
- ##############################################
- Function Prototypes
- ##############################################
- */
- extern UInt32 DFMReportInitStatus(OSType serviceCategory, UInt32 status);
-
- extern OSStatus DFMRemovePlugIns(RegEntryRef *device, OSType serviceCategory, UInt32 nrPlugIns, LogicalAddress *pluginLocatorsInUse);
-
- extern OSStatus DFMLoadPlugin(LogicalAddress pluginLocator, ConstStr63Param pluginName, PluginLoadID *pluginLoadID, LogicalAddress *main, LogicalAddress *pluginDT, TextObject optErrMsg);
-
- extern OSStatus DFMUnloadPlugin(PluginLoadID *pluginLoadID);
-
- extern OSStatus DFMGetCFragConnectID(PluginLoadID *pluginLoadID, CFragConnectionID *connectionID);
-
- /*
- ##############################################
- Well known properties in the Name Registry
- ##############################################
- */
-
- #define kPropertyName "name"
- #define kPropertyCompatible "compatible"
- #define kPropertyDriverPtr "driver-ptr"
- #define kPropertyDriverDesc "driver-description"
- #define kPropertyReg "reg"
- #define kPropertyAAPLAddress "AAPL,address"
- #define kPropertyMatching "matching"
-
- /* CPassThru */
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __DRIVERFAMILYMATCHING__ */
-
-